package weibo4andriod.b.a;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Collection;

public final class a
{
  private ArrayList a;

  public a()
  {
    this.a = new ArrayList();
  }

  public a(Object paramObject)
  {
    if (paramObject.getClass().isArray())
    {
      int i = Array.getLength(paramObject);
      for (int j = 0; ; ++j)
      {
        if (j >= i)
          return;
        Object localObject = Array.get(paramObject, j);
        this.a.add(localObject);
      }
    }
    throw new b("JSONArray initial value should be a string or collection or array.");
  }

  public a(String paramString)
  {
    this(new f(paramString));
  }

  public a(Collection paramCollection)
  {
    if (paramCollection == null);
    for (ArrayList localArrayList = new ArrayList(); ; localArrayList = new ArrayList(paramCollection))
    {
      this.a = localArrayList;
      return;
    }
  }

  public a(f paramf)
  {
    int i = paramf.c();
    char c1;
    if (i == 91)
    {
      c1 = ']';
      if (paramf.c() != ']')
        break label47;
    }
    label47: char c2;
    do
    {
      return;
      if (i == 40)
        c1 = ')';
      throw paramf.a("A JSONArray text must start with '['");
      paramf.a();
      while (true)
      {
        if (paramf.c() == ',')
        {
          paramf.a();
          this.a.add(null);
        }
        while (true)
        {
          c2 = paramf.c();
          switch (c2)
          {
          default:
            throw paramf.a("Expected a ',' or ']'");
            paramf.a();
            this.a.add(paramf.d());
          case ',':
          case ';':
          case ')':
          case ']':
          }
        }
        if (paramf.c() != ']');
        paramf.a();
      }
    }
    while (c1 == c2);
    throw paramf.a("Expected a '" + new Character(c1) + "'");
  }

  private String a(String paramString)
  {
    int i = this.a.size();
    StringBuffer localStringBuffer = new StringBuffer();
    for (int j = 0; ; ++j)
    {
      if (j >= i)
        return localStringBuffer.toString();
      if (j > 0)
        localStringBuffer.append(paramString);
      localStringBuffer.append(c.a(this.a.get(j)));
    }
  }

  public final int a()
  {
    return this.a.size();
  }

  public final Object a(int paramInt)
  {
    if ((paramInt < 0) || (paramInt >= this.a.size()));
    for (Object localObject = null; ; localObject = this.a.get(paramInt))
      return localObject;
  }

  public final String toString()
  {
    String str1;
    try
    {
      String str2 = '[' + a(",") + ']';
      str1 = str2;
      return str1;
    }
    catch (Exception localException)
    {
      str1 = null;
    }
  }
}

/* Location:           E:\Desktop\Android\wordstd\classes_dex2jar.jar
 * Qualified Name:     weibo4andriod.b.a.a
 * JD-Core Version:    0.5.3
 */